<include file="Public/header"/>
<div class="row">
  <div class="col-md-15">
    <form class="layui-form" method="post" autocomplete="off" action="" id="menuForm">
      <div class="layui-form-item">
        <label class="layui-form-label">公司名称</label>
        <div class="layui-input-inline">
          <input type="text" name="company_name"  placeholder="请输入公司名称"
          autocomplete="off" class="layui-input" value="<{$company['company_name']}>">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">子商户</label>
        <div class="layui-input-inline" style="width:400px;">
          <textarea placeholder="请输入内容" lay-verify="required" class="layui-textarea" name="kid_id"><{$company['kid_id']}></textarea>
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">商户用户表id</label>
        <div class="layui-input-inline" style="width:400px;">
          <textarea placeholder="请输入内容" lay-verify="required" class="layui-textarea" name="kids"><{$company['kids']}></textarea>
        </div>
        <div class="layui-form-mid layui-word-aux">添加子商户方法：,(英文状态下的逗号)+子商户号</div>
      </div>
      <input type="hidden" name="id" autocomplete="off" class="layui-input" value="<{$company['id']}>">
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" lay-submit lay-filter="addmenu">立即提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<include file="Public/footer"/>
<script>
    layui.use(['layer', 'form','laydate'], function(){
        var form = layui.form
            ,laydate = layui.laydate
            ,$ = layui.jquery
            ,layer = layui.layer;
          //监听提交
          form.on('submit(addmenu)', function(data){
            $.ajax({
                url:"<{:U('StatManage/editCompany')}>",
                type:'post',
                data:$('#menuForm').serialize(),
                success:function(res){
                    if(res.status){
                        layer.alert("编辑成功", {icon: 6},function () {
                            parent.location.reload();
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                    }else{
                        layer.msg(res.msg ? res.msg : "操作失败!", {icon: 5},function () {
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.layer.close(index);
                        });
                        return false;
                    }
                }
            });
            return false;
          });
	});
</script>
</body>
</html>